<?php

class GroupsController extends AppController {

    var $name = 'Groups';

    function beforeFilter() {
        parent::beforeFilter();
        $this->Auth->userModel = 'admin';
        $this->Auth->fields = array('username' => 'user', 'password' => 'mot-passe');
        //$this->Auth->allowedActions = array('*');
        $this->Auth->loginAction = array('controller' => 'admins', 'action' => 'login');
        $this->Auth->loginRedirect = array('controller' => 'pages', 'action' => 'display', 'home');
        $this->Auth->logoutRedirect = array('controller' => 'pages', 'action' => 'display', 'home');
    }

    function index() {
        $this->Group->recursive = 0;
        $this->set('groups', $this->paginate());
    }

    function view($id = null) {
        if (!$id) {
            $this->Session->setFlash(__('Invalid group', true));
            $this->redirect(array('action' => 'index'));
        }
        $this->set('group', $this->Group->read(null, $id));
    }

    function add() {
        if (!empty($this->data)) {
            $this->Group->create();
            if ($this->Group->save($this->data)) {
                $group = & $this->Group;
                $group->id = $this->Group->id;
                $this->Acl->allow($group, 'controllers/Admins/logout');
                $this->Session->setFlash(__('The group has been saved ', true));
                $this->redirect(array('action' => 'index'));
            } else {
                $this->Session->setFlash(__('The group could not be saved. Please, try again.', true));
            }
        }
    }

    function edit($id = null) {
        if (!$id && empty($this->data)) {
            $this->Session->setFlash(__('Invalid group', true));
            $this->redirect(array('action' => 'index'));
        }
        if (!empty($this->data)) {
            if ($this->Group->save($this->data)) {
                $this->Session->setFlash(__('The group has been saved', true));
                $this->redirect(array('action' => 'index'));
            } else {
                $this->Session->setFlash(__('The group could not be saved. Please, try again.', true));
            }
        }
        if (empty($this->data)) {
            $this->data = $this->Group->read(null, $id);
        }
    }

    function delete($id = null) {
        if (!$id) {
            $this->Session->setFlash(__('Invalid id for group', true));
            $this->redirect(array('action' => 'index'));
        }
        if ($this->Group->delete($id)) {

            $this->Session->setFlash(__('Group deleted', true));
            $this->redirect(array('action' => 'index'));
        }
        $this->Session->setFlash(__('Group was not deleted', true));
        $this->redirect(array('action' => 'index'));
    }

    function liste_groups(){
        $this->Group->recursive = 0;
        $this->set('groups', $this->paginate());
    }

    function droits($id) {

        $group = & $this->Group;
        $group->id = $id;
        $this->set('id_group',$id);
        $permi = $this->Acl->check($group, 'controllers/Admins/logout');
        if ($permi == '') {
            $permi = 0;
        }

        if (!empty($_POST)) {
//            debug($_POST);

            /*
             * Droits Audio
             */
            if (isset($_POST['AudioAjouter'])) {
                $this->Acl->allow($group, 'controllers/Fichiers/ajouter_audios');
            } else {
                $this->Acl->deny($group, 'controllers/Fichiers/ajouter_audios');
            }
            if (isset($_POST['AudioModifier'])) {
                $this->Acl->allow($group, 'controllers/Fichiers/liste_editer_audio');
                $this->Acl->allow($group, 'controllers/Fichiers/modifier_audio_final');
                $this->Acl->allow($group, 'controllers/Fichiers/modifier_complete_audio');
            } else {
                $this->Acl->deny($group, 'controllers/Fichiers/liste_editer_audio');
                $this->Acl->deny($group, 'controllers/Fichiers/modifier_audio_final');
                $this->Acl->deny($group, 'controllers/Fichiers/modifier_complete_audio');
            }
            if (isset($_POST['AudioEffacer'])) {
                $this->Acl->allow($group, 'controllers/Fichiers/effacer_audios');
                $this->Acl->allow($group, 'controllers/Fichiers/effacer_audios_final');
                $this->Acl->allow($group, 'controllers/Fichiers/effacer_audios_completo');
            } else {
                $this->Acl->deny($group, 'controllers/Fichiers/effacer_audios');
                $this->Acl->deny($group, 'controllers/Fichiers/effacer_audios_final');
                $this->Acl->deny($group, 'controllers/Fichiers/effacer_audios_completo');
            }

            /*
             * Droits Jeux
             */
            if (isset($_POST['JeuxAjouter'])) {
                $this->Acl->allow($group, 'controllers/Fichiers/ajouter_jeux');
            } else {
                $this->Acl->deny($group, 'controllers/Fichiers/ajouter_jeux');
            }
            if (isset($_POST['JeuxModifier'])) {
                $this->Acl->allow($group, 'controllers/Fichiers/liste_editer_jeux');
                $this->Acl->allow($group, 'controllers/Fichiers/modifier_jeux_final');
                $this->Acl->allow($group, 'controllers/Fichiers/modifier_complete_jeux');
            } else {
                $this->Acl->deny($group, 'controllers/Fichiers/liste_editer_jeux');
                $this->Acl->deny($group, 'controllers/Fichiers/modifier_jeux_final');
                $this->Acl->deny($group, 'controllers/Fichiers/modifier_complete_jeux');
            }
            if (isset($_POST['JeuxEffacer'])) {
                $this->Acl->allow($group, 'controllers/Fichiers/effacer_jeux');
                $this->Acl->allow($group, 'controllers/Fichiers/effacer_jeux_final');
                $this->Acl->allow($group, 'controllers/Fichiers/effacer_jeux_completo');
            } else {
                $this->Acl->deny($group, 'controllers/Fichiers/effacer_jeux');
                $this->Acl->deny($group, 'controllers/Fichiers/effacer_jeux_final');
                $this->Acl->deny($group, 'controllers/Fichiers/effacer_jeux_completo');
            }


            /*
             * Droits Categories
             */
            if (isset($_POST['CategoriesAjouter'])) {
                $this->Acl->allow($group, 'controllers/Categories/ajouter_categorie');
            } else {
                $this->Acl->deny($group, 'controllers/Categories/ajouter_categorie');
            }
            if (isset($_POST['CategoriesModifier'])) {
                $this->Acl->allow($group, 'controllers/Categories/liste_editer_categorie');
                $this->Acl->allow($group, 'controllers/Categories/modifier_categorie_final');
                $this->Acl->allow($group, 'controllers/Categories/modifier_complete_categorie');
            } else {
                $this->Acl->deny($group, 'controllers/Categories/liste_editer_categorie');
                $this->Acl->deny($group, 'controllers/Categories/modifier_categorie_final');
                $this->Acl->deny($group, 'controllers/Categories/modifier_complete_categorie');
            }
            if (isset($_POST['CategoriesEffacer'])) {
                $this->Acl->allow($group, 'controllers/Categories/effacer_categorie');
                $this->Acl->allow($group, 'controllers/Categories/effacer_categorie_final');
                $this->Acl->allow($group, 'controllers/Categories/effacer_categorie_completo');
            } else {
                $this->Acl->deny($group, 'controllers/Categories/effacer_categorie');
                $this->Acl->deny($group, 'controllers/Categories/effacer_categorie_final');
                $this->Acl->deny($group, 'controllers/Categories/effacer_categorie_completo');
            }



            /*
             * Droits Articles
             */
            if (isset($_POST['ArticlesAjouter'])) {
                $this->Acl->allow($group, 'controllers/Articles/ajouter_articles');
            } else {
                $this->Acl->deny($group, 'controllers/Articles/ajouter_articles');
            }
            if (isset($_POST['ArticlesModifier'])) {
                $this->Acl->allow($group, 'controllers/Articles/liste_editer_lien');
                $this->Acl->allow($group, 'controllers/Articles/modifier_lien_final');
                $this->Acl->allow($group, 'controllers/Articles/modifier_complete_lien');
            } else {
                $this->Acl->deny($group, 'controllers/Articles/liste_editer_lien');
                $this->Acl->deny($group, 'controllers/Articles/modifier_lien_final');
                $this->Acl->deny($group, 'controllers/Articles/modifier_complete_lien');
            }
            if (isset($_POST['ArticlesEffacer'])) {
                $this->Acl->allow($group, 'controllers/Articles/effacer_liens');
                $this->Acl->allow($group, 'controllers/Articles/effacer_liens_final');
                $this->Acl->allow($group, 'controllers/Articles/effacer_liens_completo');
            } else {
                $this->Acl->deny($group, 'controllers/Articles/effacer_liens');
                $this->Acl->deny($group, 'controllers/Articles/effacer_liens_final');
                $this->Acl->deny($group, 'controllers/Articles/effacer_liens_completo');
            }

            /*
             * Droits Commentaires
             */

            if (isset($_POST['CommentairesGestion'])) {
                $this->Acl->allow($group, 'controllers/Commentaires/valider_liste');
                $this->Acl->allow($group, 'controllers/Commentaires/edit_effacer');
                $this->Acl->allow($group,'controllers/Commentaires/liste_editer_coments');
                $this->Acl->allow($group,'controllers/Commentaires/liste_editer_coments');
                $this->Acl->allow($group,'controllers/Commentaires/modifier_coments_final');
                $this->Acl->allow($group,'controllers/Commentaires/modifier_complete_coments');
                $this->Acl->allow($group,'controllers/Commentaires/effacer_coments_final');

            } else {
                $this->Acl->deny($group, 'controllers/Commentaires/valider_liste');
                $this->Acl->deny($group, 'controllers/Commentaires/edit_effacer');
                $this->Acl->deny($group,'controllers/Commentaires/liste_editer_coments');
                $this->Acl->deny($group,'controllers/Commentaires/liste_editer_coments');
                $this->Acl->deny($group,'controllers/Commentaires/modifier_coments_final');
                $this->Acl->deny($group,'controllers/Commentaires/modifier_complete_coments');
                $this->Acl->deny($group,'controllers/Commentaires/effacer_coments_final');
            }

            /*
             * Droits images
             */

            if (isset($_POST['ImagesAjouter'])) {
                $this->Acl->allow($group, 'controllers/Fichiers/ajouter_images');
            } else {
                $this->Acl->deny($group, 'controllers/Fichiers/ajouter_images');
            }
            if (isset($_POST['ImagesModifier'])) {
                $this->Acl->allow($group, 'controllers/Fichiers/liste_editer_images');
                $this->Acl->allow($group, 'controllers/Fichiers/modifier_images_final');
                $this->Acl->allow($group, 'controllers/Fichiers/modifier_complete_images');
            } else {
                $this->Acl->deny($group, 'controllers/Fichiers/liste_editer_images');
                $this->Acl->deny($group, 'controllers/Fichiers/modifier_images_final');
                $this->Acl->deny($group, 'controllers/Fichiers/modifier_complete_images');
            }
            if (isset($_POST['ImagesEffacer'])) {
                $this->Acl->allow($group, 'controllers/Fichiers/effacer_image');
                $this->Acl->allow($group, 'controllers/Fichiers/effacer_image_final');
                $this->Acl->allow($group, 'controllers/Fichiers/effacer_image_completo');
            } else {
                $this->Acl->deny($group, 'controllers/Fichiers/effacer_image');
                $this->Acl->deny($group, 'controllers/Fichiers/effacer_image_final');
                $this->Acl->deny($group, 'controllers/Fichiers/effacer_image_completo');
            }

            /*
             * Droits Videos
             */


            if (isset($_POST['VideosAjouter'])) {
                $this->Acl->allow($group, 'controllers/Fichiers/ajouter_videos');
            } else {
                $this->Acl->deny($group, 'controllers/Fichiers/ajouter_videos');
            }
            if (isset($_POST['VideosModifier'])) {
                $this->Acl->allow($group, 'controllers/Fichiers/liste_editer_video');
                $this->Acl->allow($group, 'controllers/Fichiers/modifier_video_final');
                $this->Acl->allow($group, 'controllers/Fichiers/modifier_complete_video');
            } else {
                $this->Acl->deny($group, 'controllers/Fichiers/liste_editer_video');
                $this->Acl->deny($group, 'controllers/Fichiers/modifier_video_final');
                $this->Acl->deny($group, 'controllers/Fichiers/modifier_complete_video');
            }
            if (isset($_POST['VideosEffacer'])) {
                $this->Acl->allow($group, 'controllers/Fichiers/effacer_videos');
                $this->Acl->allow($group, 'controllers/Fichiers/effacer_videos_final');
                $this->Acl->allow($group, 'controllers/Fichiers/effacer_videos_completo');
            } else {
                $this->Acl->deny($group, 'controllers/Fichiers/effacer_videos');
                $this->Acl->deny($group, 'controllers/Fichiers/effacer_videos_final');
                $this->Acl->deny($group, 'controllers/Fichiers/effacer_videos_completo');
            }

            /*
         *   * Droits Sous-titres
             */

             if (isset($_POST['SoustitresAjouterV'])) {
                 $this->Acl->allow($group, 'controllers/Subtitres/add_subtitres_videos');
                $this->Acl->allow($group, 'controllers/Subtitres/add_subtitres_video_final');
            } else {
                $this->Acl->deny($group, 'controllers/Subtitres/add_subtitres_videos');
                $this->Acl->deny($group, 'controllers/Subtitres/add_subtitres_video_final');
            }
            if (isset($_POST['SoustitresModifierV'])) {
                $this->Acl->allow($group, 'controllers/Fichiers/liste_editer_subtitres_videos');
                $this->Acl->allow($group, 'controllers/Fichiers/editer_subtitres_videos');
                $this->Acl->allow($group, 'controllers/Fichiers/editer_subtitres_videos_otro');
            } else {
                $this->Acl->deny($group, 'controllers/Fichiers/liste_editer_subtitres_videos');
                $this->Acl->deny($group, 'controllers/Fichiers/editer_subtitres_videos');
                $this->Acl->deny($group, 'controllers/Fichiers/editer_subtitres_videos_otro');
            }
             if (isset($_POST['SoustitresAjouterA'])) {
                $this->Acl->allow($group, 'controllers/Subtitres/add_subtitres_audios');
                 $this->Acl->allow($group, 'controllers/Subtitres/add_subtitres_audios_final');
            } else {
                $this->Acl->deny($group, 'controllers/Subtitres/add_subtitres_audios');
                $this->Acl->deny($group, 'controllers/Subtitres/add_subtitres_audios_final');
            }
            if (isset($_POST['SoustitresModifierA'])) {
                $this->Acl->allow($group, 'controllers/Fichiers/liste_editer_subtitres_audios');
                $this->Acl->allow($group, 'controllers/Fichiers/editer_subtitres_audios');
                $this->Acl->allow($group, 'controllers/Fichiers/editer_subtitres_audios_otros');
            } else {
               $this->Acl->deny($group, 'controllers/Fichiers/liste_editer_subtitres_audios');
                $this->Acl->deny($group, 'controllers/Fichiers/editer_subtitres_audios');
                $this->Acl->deny($group, 'controllers/Fichiers/editer_subtitres_audios_otros');
            }
            if (isset($_POST['SoustitresEffacer'])) {
                $this->Acl->allow($group, 'controllers/Subtitres/lister_fichiers');
                $this->Acl->allow($group, 'controllers/Subtitres/supprimer');
            } else {
                $this->Acl->deny($group, 'controllers/Subtitres/lister_fichiers');
                $this->Acl->deny($group, 'controllers/Subtitres/supprimer');
            }

            /*
             * Droits Glossaire
             */

            if (isset($_POST['GlossaireAjouter'])) {
                $this->Acl->allow($group, 'controllers/Glossaires/ajouter_items');
            } else {
                $this->Acl->deny($group, 'controllers/Glossaires/ajouter_items');
            }
            if (isset($_POST['GlossaireModifier'])) {
                $this->Acl->allow($group, 'controllers/Glossaires/liste_editer_items');
                $this->Acl->allow($group, 'controllers/Glossaires/modifier_items_final');
                $this->Acl->allow($group, 'controllers/Glossaires/modifier_complete_items');
            } else {
                $this->Acl->deny($group, 'controllers/Glossaires/liste_editer_items');
                $this->Acl->deny($group, 'controllers/Glossaires/modifier_items_final');
                $this->Acl->deny($group, 'controllers/Glossaires/modifier_complete_items');
            }
            if (isset($_POST['GlossaireEffacer'])) {
                $this->Acl->allow($group, 'controllers/Glossaires/effacer_items');
                $this->Acl->allow($group, 'controllers/Glossaires/effacer_items_final');
                $this->Acl->allow($group, 'controllers/Glossaires/effacer_items_completo');
            } else {
                $this->Acl->deny($group, 'controllers/Glossaires/effacer_items');
                $this->Acl->deny($group, 'controllers/Glossaires/effacer_items_final');
                $this->Acl->deny($group, 'controllers/Glossaires/effacer_items_completo');
            }


            /*
             * Droits Texts
             */

            if (isset($_POST['TexteGestion'])) {
                $this->Acl->allow($group, 'controllers/Texts/lister_sections');
                $this->Acl->allow($group, 'controllers/Texts/modifier_section');
            } else {
                $this->Acl->deny($group, 'controllers/Texts/lister_sections');
                $this->Acl->deny($group, 'controllers/Texts/modifier_section');
            }

            /*
             * Droits Image de fond
             */

            if (isset($_POST['ImageFond'])) {
                $this->Acl->allow($group, 'controllers/Fichiers/ajouter_fondo');
            } else {
                $this->Acl->deny($group, 'controllers/Fichiers/ajouter_fondo');
            }


        }

        

        






        //debug($permi);

        $permisos['Audio']['ajouter'] = $this->Acl->check($group, 'controllers/Fichiers/ajouter_audios');
        $permisos['Audio']['modifier'] = $this->Acl->check($group, 'controllers/Fichiers/liste_editer_audio');
        $permisos['Audio']['effacer'] = $this->Acl->check($group, 'controllers/Fichiers/effacer_audios');
        $permisos['Jeux']['ajouter'] = $this->Acl->check($group, 'controllers/Fichiers/ajouter_jeux');
        $permisos['Jeux']['modifier'] = $this->Acl->check($group, 'controllers/Fichiers/liste_editer_jeux');
        $permisos['Jeux']['effacer'] = $this->Acl->check($group, 'controllers/Fichiers/effacer_jeux');
        $permisos['Categories']['ajouter'] = $this->Acl->check($group, 'controllers/Categories/ajouter_categorie');
        $permisos['Categories']['modifier'] = $this->Acl->check($group, 'controllers/Categories/liste_editer_categorie');
        $permisos['Categories']['effacer'] = $this->Acl->check($group, 'controllers/Categories/effacer_categorie');
        $permisos['Articles']['ajouter'] = $this->Acl->check($group, 'controllers/Articles/ajouter_articles');
        $permisos['Articles']['modifier'] = $this->Acl->check($group, 'controllers/Articles/liste_editer_lien');
        $permisos['Articles']['effacer'] = $this->Acl->check($group, 'controllers/Articles/effacer_liens');
        $permisos['Commentaires']['gestion'] = $this->Acl->check($group, 'controllers/Commentaires/valider_liste');
        $permisos['Images']['ajouter'] = $this->Acl->check($group, 'controllers/Fichiers/ajouter_images');
        $permisos['Images']['modifier'] = $this->Acl->check($group, 'controllers/Fichiers/liste_editer_images');
        $permisos['Images']['effacer'] = $this->Acl->check($group, 'controllers/Fichiers/effacer_image');
        $permisos['Videos']['ajouter'] = $this->Acl->check($group, 'controllers/Fichiers/ajouter_videos');
        $permisos['Videos']['modifier'] = $this->Acl->check($group, 'controllers/Fichiers/liste_editer_video');
        $permisos['Videos']['effacer'] = $this->Acl->check($group, 'controllers/Fichiers/effacer_videos');
        $permisos['Subtitres']['ajouterV'] = $this->Acl->check($group, 'controllers/Subtitres/add_subtitres_videos');
        $permisos['Subtitres']['modifierV'] = $this->Acl->check($group, 'controllers/Fichiers/liste_editer_subtitres_videos');
        $permisos['Subtitres']['ajouterA'] = $this->Acl->check($group, 'controllers/Subtitres/add_subtitres_audios');
        $permisos['Subtitres']['modifierA'] = $this->Acl->check($group, 'controllers/Fichiers/liste_editer_subtitres_audios');
        $permisos['Subtitres']['effacer'] = $this->Acl->check($group, 'controllers/Subtitres/lister_fichiers');
        $permisos['Glossaire']['ajouter'] = $this->Acl->check($group, 'controllers/Glossaires/ajouter_items');
        $permisos['Glossaire']['modifier'] = $this->Acl->check($group, 'controllers/Glossaires/liste_editer_items');
        $permisos['Glossaire']['effacer'] = $this->Acl->check($group, 'controllers/Glossaires/effacer_items');
        $permisos['Texts']['gestion'] = $this->Acl->check($group, 'controllers/Texts/lister_sections');
        $permisos['Image']['fond'] = $this->Acl->check($group, 'controllers/Fichiers/ajouter_fondo');

        $this->set('permisos', $permisos);


//       /*
//         * Droits Audio
//         */
//        if ('Audio') {
//            /*
//             * Allow
//             */
//            //ajouter
//            $this->Acl->allow($group, 'controllers/Fichiers/ajouter_audios');
//            //modifier
//            $this->Acl->allow($group, 'controllers/Fichiers/liste_editer_audio');
//            $this->Acl->allow($group, 'controllers/Fichiers/modifier_audio_final');
//            $this->Acl->allow($group, 'controllers/Fichiers/modifier_complete_audio');
//            //effacer
//            $this->Acl->allow($group, 'controllers/Fichiers/effacer_audios');
//            $this->Acl->allow($group, 'controllers/Fichiers/effacer_audios_final');
//            $this->Acl->allow($group, 'controllers/Fichiers/effacer_audios_completo');
//        } else {
//            /*
//             * Deny
//             */
//            //ajouter
//            $this->Acl->deny($group, 'controllers/Fichiers/ajouter_audios');
//            //modifier
//            $this->Acl->deny($group, 'controllers/Fichiers/liste_editer_audio');
//            $this->Acl->deny($group, 'controllers/Fichiers/modifier_audio_final');
//            $this->Acl->deny($group, 'controllers/Fichiers/modifier_complete_audio');
//            //effacer
//            $this->Acl->deny($group, 'controllers/Fichiers/effacer_audios');
//            $this->Acl->deny($group, 'controllers/Fichiers/effacer_audios_final');
//            $this->Acl->deny($group, 'controllers/Fichiers/effacer_audios_completo');
//        }
//
//        /*
//         * Droits Jeux
//         */
//
//        if('Jeux'){
//            /*
//             * Allow
//             */
//            //ajouter
//            $this->Acl->allow($group, 'controllers/Fichiers/ajouter_jeux');
//            //modifier
//            $this->Acl->allow($group, 'controllers/Fichiers/liste_editer_jeux');
//            $this->Acl->allow($group, 'controllers/Fichiers/modifier_jeux_final');
//            $this->Acl->allow($group, 'controllers/Fichiers/modifier_complete_jeux');
//            //effacer
//            $this->Acl->allow($group, 'controllers/Fichiers/effacer_jeux');
//            $this->Acl->allow($group, 'controllers/Fichiers/effacer_jeux_final');
//            $this->Acl->allow($group, 'controllers/Fichiers/effacer_jeux_completo');
//        } else {
//            /*
//             * Deny
//             */
//            //ajouter
//            $this->Acl->deny($group, 'controllers/Fichiers/ajouter_jeux');
//            //modifier
//            $this->Acl->deny($group, 'controllers/Fichiers/liste_editer_jeux');
//            $this->Acl->deny($group, 'controllers/Fichiers/modifier_jeux_final');
//            $this->Acl->deny($group, 'controllers/Fichiers/modifier_complete_jeux');
//            //effacer
//            $this->Acl->deny($group, 'controllers/Fichiers/effacer_jeux');
//            $this->Acl->deny($group, 'controllers/Fichiers/effacer_jeux_final');
//            $this->Acl->deny($group, 'controllers/Fichiers/effacer_jeux_completo');
//        }
//
//
//        /*
//         * Droits Categories
//         */
//
//        if('Categories'){
//            /*
//             * Allow
//             */
//            //ajouter
//            $this->Acl->allow($group, 'controllers/Categories/ajouter_categorie');
//            //modifier
//            $this->Acl->allow($group, 'controllers/Categories/liste_editer_categorie');
//            $this->Acl->allow($group, 'controllers/Categories/modifier_categorie_final');
//            $this->Acl->allow($group, 'controllers/Categories/modifier_complete_categorie');
//            //effacer
//            $this->Acl->allow($group, 'controllers/Categories/effacer_categorie');
//            $this->Acl->allow($group, 'controllers/Categories/effacer_categorie_final');
//            $this->Acl->allow($group, 'controllers/Categories/effacer_categorie_completo');
//        } else {
//            /*
//             * Deny
//             */
//            //ajouter
//            $this->Acl->deny($group, 'controllers/Categories/ajouter_categorie');
//            //modifier
//            $this->Acl->deny($group, 'controllers/Categories/liste_editer_categorie');
//            $this->Acl->deny($group, 'controllers/Categories/modifier_categorie_final');
//            $this->Acl->deny($group, 'controllers/Categories/modifier_complete_categorie');
//            //effacer
//            $this->Acl->deny($group, 'controllers/Categories/effacer_categorie');
//            $this->Acl->deny($group, 'controllers/Categories/effacer_categorie_final');
//            $this->Acl->deny($group, 'controllers/Categories/effacer_categorie_completo');
//        }
//
//
//         /*
//         * Droits Articles/liens
//         */
//
//        if('Articles'){
//            /*
//             * Allow
//             */
//            //ajouter
//            $this->Acl->allow($group, 'controllers/Articles/ajouter_articles');
//            //modifier
//            $this->Acl->allow($group, 'controllers/Articles/liste_editer_lien');
//            $this->Acl->allow($group, 'controllers/Articles/modifier_lien_final');
//            $this->Acl->allow($group, 'controllers/Articles/modifier_complete_lien');
//            //effacer
//            $this->Acl->allow($group, 'controllers/Articles/effacer_liens');
//            $this->Acl->allow($group, 'controllers/Articles/effacer_liens_final');
//            $this->Acl->allow($group, 'controllers/Articles/effacer_liens_completo');
//        } else {
//            /*
//             * Deny
//             */
//            //ajouter
//            $this->Acl->deny($group, 'controllers/Articles/ajouter_articles');
//            //modifier
//            $this->Acl->deny($group, 'controllers/Articles/liste_editer_lien');
//            $this->Acl->deny($group, 'controllers/Articles/modifier_lien_final');
//            $this->Acl->deny($group, 'controllers/Articles/modifier_complete_lien');
//            //effacer
//            $this->Acl->deny($group, 'controllers/Articles/effacer_liens');
//            $this->Acl->deny($group, 'controllers/Articles/effacer_liens_final');
//            $this->Acl->deny($group, 'controllers/Articles/effacer_liens_completo');
//        }
//
//
//         /*
//         * Droits Commentaires
//         */
//
//        if('Commentaires'){
//            /*
//             * Allow
//             */
//            //Gestion
//            $this->Acl->allow($group, 'controllers/Commentaires/valider_liste');
//            $this->Acl->allow($group, 'controllers/Commentaires/edit_effacer');
//
//        } else {
//            /*
//             * Deny
//             */
//            //Gestion
//            $this->Acl->deny($group, 'controllers/Commentaires/valider_liste');
//            $this->Acl->deny($group, 'controllers/Commentaires/edit_effacer');
//
//        }
//
//
//
//
//        /*
//         * Droits images
//         */
//
//         if('Images'){
//            /*
//             * Allow
//             */
//            //ajouter
//            $this->Acl->allow($group, 'controllers/Fichiers/ajouter_images');
//            //modifier
//            $this->Acl->allow($group, 'controllers/Fichiers/liste_editer_images');
//            $this->Acl->allow($group, 'controllers/Fichiers/modifier_images_final');
//            $this->Acl->allow($group, 'controllers/Fichiers/modifier_complete_images');
//            //effacer
//            $this->Acl->allow($group, 'controllers/Fichiers/effacer_image');
//            $this->Acl->allow($group, 'controllers/Fichiers/effacer_image_final');
//            $this->Acl->allow($group, 'controllers/Fichiers/effacer_image_completo');
//        } else {
//            /*
//             * Deny
//             */
//            //ajouter
//            $this->Acl->deny($group, 'controllers/Fichiers/ajouter_images');
//            //modifier
//            $this->Acl->deny($group, 'controllers/Fichiers/liste_editer_images');
//            $this->Acl->deny($group, 'controllers/Fichiers/modifier_images_final');
//            $this->Acl->deny($group, 'controllers/Fichiers/modifier_complete_images');
//            //effacer
//            $this->Acl->deny($group, 'controllers/Fichiers/effacer_image');
//            $this->Acl->deny($group, 'controllers/Fichiers/effacer_image_final');
//            $this->Acl->deny($group, 'controllers/Fichiers/effacer_image_completo');
//        }
//
//
//
//        /*
//         * Droits Videos
//         */
//
//         if('Video'){
//            /*
//             * Allow
//             */
//            //ajouter
//            $this->Acl->allow($group, 'controllers/Fichiers/ajouter_videos');
//            //modifier
//            $this->Acl->allow($group, 'controllers/Fichiers/liste_editer_video');
//            $this->Acl->allow($group, 'controllers/Fichiers/modifier_video_final');
//            $this->Acl->allow($group, 'controllers/Fichiers/modifier_complete_video');
//            //effacer
//            $this->Acl->allow($group, 'controllers/Fichiers/effacer_videos');
//            $this->Acl->allow($group, 'controllers/Fichiers/effacer_videos_final');
//            $this->Acl->allow($group, 'controllers/Fichiers/effacer_videos_completo');
//        } else {
//            /*
//             * Deny
//             */
//            //ajouter
//            $this->Acl->deny($group, 'controllers/Fichiers/ajouter_videos');
//            //modifier
//            $this->Acl->deny($group, 'controllers/Fichiers/liste_editer_video');
//            $this->Acl->deny($group, 'controllers/Fichiers/modifier_video_final');
//            $this->Acl->deny($group, 'controllers/Fichiers/modifier_complete_video');
//            //effacer
//            $this->Acl->deny($group, 'controllers/Fichiers/effacer_videos');
//            $this->Acl->deny($group, 'controllers/Fichiers/effacer_videos_final');
//            $this->Acl->deny($group, 'controllers/Fichiers/effacer_videos_completo');
//        }
//
//        $this->loadModel('ArosAco');
//        $this->set('acos', $this->ArosAco->find('all'));
    }

}

?>